/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.wxs.controller;

import cn.webrx.wxs.mapper.GoodsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * <p>Project: wxshop - IndexController
 * <p>Powered by webrx On 2021-04-16 19:09:41
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 15
 */
@Controller
@RequestMapping("/index")
@Slf4j
public class IndexController {
    @Autowired
    private GoodsMapper goodsdao;

    @RequestMapping("/")
    public ModelAndView index() {
        ModelAndView mv = new ModelAndView("index/index");
        mv.addObject("goods", goodsdao.selectAll());
        return mv;
    }
}
